<template>
  <div ref="divRef">
    {{count}}
  </div>
</template>
<script setup>

import { nextTick, ref, watch, watchEffect } from 'vue'

const divRef = ref()
const count = ref(0)

setTimeout(()=>{
  count.value++
})

// watch(count,(newVal,oldVal)=>{
//   console.log(newVal,oldVal)
//   if(divRef.value){
//     console.log(divRef.value.innerHTML)
//   }
// },{
//   //flush:'post'
// })

watchEffect(()=>{
  console.log(count.value)
  if(divRef.value){
    console.log(divRef.value.innerHTML)
  }
},{
  flush:'post'
})

</script>

<style scoped>

</style>
